package com.hdwe.tools.pm.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.hdwe.tools.pm.domain.PmTask;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.constant.CacheNames;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;



/**
 * 任务视图对象 pm_task
 *
 * @author s
 * @date 2024-12-10
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = PmTask.class)
public class PmTaskVo extends BaseEntityVO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ExcelProperty(value = "主键")
    private Long id;

    /**
     * 标题
     */
    @ExcelProperty(value = "标题")
    private String title;

    /**
     * 项目id
     */
    @ExcelProperty(value = "项目id")
    private Long projectId;

    /**
     * 项目名称
     */
    @Translation(type = TransConstant.COMBOBOX_KEY_TO_LABEL, mapper = "projectId", other = CacheNames.COMBOBOX_PROJECT)
    @ExcelProperty(value = "项目名称")
    private String projectName;

    /**
     * 需求id
     */
    @ExcelProperty(value = "需求id")
    private Long requireId;

    /**
     * 需求名称
     */
    @Translation(type = TransConstant.COMBOBOX_KEY_TO_LABEL, mapper = "requireId", other = CacheNames.COMBOBOX_REQUIRE)
    @ExcelProperty(value = "需求名称")
    private Long requireName;

    /**
     * 里程碑id
     */
    @ExcelProperty(value = "里程碑id")
    private Long milestoneId;

    /**
     * 里程碑名称
     */
    @Translation(type = TransConstant.COMBOBOX_KEY_TO_LABEL, mapper = "milestoneId", other = CacheNames.COMBOBOX_MILESTONE)
    @ExcelProperty(value = "里程碑名称")
    private Long milestoneName;

    /**
     * 内容
     */
    @ExcelProperty(value = "内容")
    private String content;

    /**
     * 任务类型（dev开发任务 customer客户工单 tec技术选型 doc文档编写 test测试任务）
     */
    @ExcelProperty(value = "任务类型", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "d=ev开发任务,c=ustomer客户工单,t=ec技术选型,d=oc文档编写,t=est测试任务")
    private String taskType;

    /**
     * 优先级（low低 middle中 high高）
     */
    @ExcelProperty(value = "优先级", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "l=ow低,m=iddle中,h=igh高")
    private String priority;

    /**
     * 负责人
     */
    @ExcelProperty(value = "负责人")
    private String owner;

    /**
     * 任务负责人名称
     */
    @TableField(exist = false)
    @Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "owner")
    private String ownerName;

    /**
     * 开始时间
     */
    @ExcelProperty(value = "开始时间")
    private LocalDateTime startDate;

    /**
     * 截止时间（从需求或小目标同步，不可修改）
     */
    @ExcelProperty(value = "截止时间")
    private LocalDateTime endDate;

    /**
     * 耗时
     */
    @ExcelProperty(value = "耗时")
    private Long costTime;

    /**
     * 图片、文件
     */
    @ExcelProperty(value = "图片、文件")
    private String files;

    /**
     * 任务标签
     */
    @ExcelProperty(value = "任务标签")
    private String tags;

    /**
     * 关联人员
     */
    @ExcelProperty(value = "关联人员")
    private String relatedUsers;

    /**
     * 关联人员名称
     */
    @Translation(type = TransConstant.COMBOBOX_KEY_TO_LABEL, mapper = "relatedUsers", other = CacheNames.COMBOBOX_USER)
    @ExcelProperty(value = "关联人员名称")
    private String relatedUsersName;

    /**
     * 状态（未开始ready 进行中doing 完成finished 阻塞blocked 取消cancel 延期delay）
     */
    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "ready=未开始,doing=进行中,finished=完成,blocked阻塞,cancel=取消,delay=延期")
    private String status;

    /**
     * 创建部门
     */
    @ExcelProperty(value = "创建部门")
    private Long createDept;

    /**
     * 创建者
     */
    @ExcelProperty(value = "创建者")
    private Long createBy;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 修改者
     */
    @ExcelProperty(value = "修改者")
    private Long updateBy;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    private Date updateTime;


}
